home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS in a Box 7
/
BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso
/
Files
/
Prog
/
M
/
Monitor.cpt
/
Monitor ReadMe
< prev
next >
Wrap
Text File
|
1990-01-09
|
8KB
|
161 lines
===========================================================================
"Monitor" An Asynchronous Serial Line Monitor Program For The Macintosh
===========================================================================
Version 1.0 (12-Dec-89)
___________________________________________________________________________
INTRODUCTION
"Monitor" monitors the two serial input lines (modem and printer port) of
the Macintosh and dumps the results to a text file on disk. The purpose is
to tap the receive and transmit lines of a serial asynchronous connection
between two other devices (e.g. another Macintosh and a modem) and to see
what is going on. This was especially useful for developing file transfer
protocols for my terminal program "Terminal" (current version is 1.7).
___________________________________________________________________________
WHAT YOU NEED
You need a spare Macintosh Plus (or newer) to be devoted exclusively to the
serial line monitoring. It's better to use a hard disk, I have not tried to
dump to diskettes. Then you should make a cable using the following picture
as a guide. The pin assignments for the Macintosh can be found in "Apple
Macintosh Family Hardware Reference". Modems generally use DB-25
connecters. Use pins 2, 3 and 7.
"Monitor" was tested on a Macintosh Plus and a Macintosh IIcx using System
6.03. I made no attempt to stay compatible with earlier System versions. If
you want to modify the sources you need the THINK C 3.02 compiler.
+----------+ TxD +----------+
| O----------•------>---------------O |
| | RxD | | |
| Mac IIcx O-----------------<--•------------O Modem |
| | Gnd | | | |
| O---------------•-----------------O |
+----------+ | | | +----------+
| | |
+----------+ RxD | | |
| Modem O------<---+ | |
| port | Gnd | |
| O---------------• |
| Mac Plus | RxD | |
| | | |
| Printer O------<-------------+
| port | Gnd |
| O---------------+
+----------+
___________________________________________________________________________
WHAT YOU GET
In fact you get two programs: "Monitor" and "Monitor Config". "Monitor" is
the program to start monitoring the serial lines. "Monitor Config" is a
program for modifying the parameters "Monitor" needs to run. As you see
"Monitor Config" is bigger than "Monitor" proving again that the user
interface is 80 percent of the work of a program.
___________________________________________________________________________
MONITOR CONFIG
To configure "Monitor" start up "Monitor Config". A standard get file
dialog appears. Find and select "Monitor" as the file to open. Then you get
a dialog with the current parameters used by "Monitor".
File name:
This will be the prefix of the TEXT file name "Monitor" will use when
dumping the serial data to disk. "Monitor" will append a serial number to
make sure no file gets deleted. The file will be created in the same folder
from where "Monitor" was started. E.g. if you specify "Dump #" as file
name, the first file created will be "Dump #1", then "Dump #2" and so on.
File creator:
This is the TEXT file creator (4 characters) to be used, so that if you
double click on a dump file your favorite TEXT editor is launched. Use
"ResEdit" to check the creator of your TEXT editor. Remember that a dump
file is plain TEXT, there is no need for a full fledged word processor, but
your TEXT editor should be able to read large files (i.e. greater than
32000 characters).
Timeout:
This value in ticks (there are 60.15 ticks per second) is used by "Monitor"
to dump out one port. This means, that if after the timeout there are no
new characters for a given port the characters collected in the input
buffer are dumped out to the file.
Limit:
This is the size in characters to be used as input buffer for the two
ports. If the input buffer fills up to this limit it is dumped to the file.
Port A (modem) and port B (printer) settings:
There are popup menus for selecting the speed, the number of data bits, the
type of parity and the number of stop bits for each port. The two ports are
completely independent one of each other. Note that the number of stop bits
is not really necessary, the Zilog SCC inside the Macintosh will receive
any number of stop bits, and the number of stop bits specified are used
only for transmitting, but we are only receiving here.
___________________________________________________________________________
MONITOR
As soon as "Monitor" is started it tries to open the two serial ports. This
fails if AppleTalk is active, so make sure AppleTalk is disconnected
("Chooser" DA). Then "Monitor" puts up a Window with a "Stop" button and
starts monitoring, dumping everything into a TEXT file on disk. To stop
"Monitor" simply click on the "Stop" button or press any key while
"Monitor"s window is active.
"Monitor" works as follows to monitor the two ports. It cyclically checks
both ports. If anything is received it is first put into a buffer. If the
buffer fills up it is dumped out to the file. If something is received on
the other port the buffer is also dumped out first. If nothing is received
for a certain time, and the buffer is not empty it is dumped out.
The output looks like this (this is the beginning of a CompuServe QuickB
file upload, port B is CompusServe and I am port A):
8455 B: 0D 0A 0A 55 70 6C 6F 61 64 69 6E 67 20 6D 61 69 ...Uploading mai
8566 B: 6C 0D 05 l..
8671 A: 10 2B 10 30 .+.0
8678 B: 10 42 31 2B 10 41 10 41 10 48 10 41 10 43 10 40 .B1+.A.A.H.A.C.@
8686 B: 10 54 10 40 D4 10 40 10 40 10 40 10 40 10 40 10 .T.@..@.@.@.@.@.
8694 B: 40 10 40 10 40 03 2B @.@.@.+
8791 A: 10 42 32 2B 01 01 08 01 01 03 5D .B2+......]
8826 B: 10 32 10 42 33 54 55 41 6D 61 69 6C 03 D5 A3 .2.B3TUAmail...
8833 A: 10 42 34 4E 54 6F 3A 20 3E 49 4E 54 45 52 4E 45 .B4NTo: >INTERNE
8841 A: 54 3A 61 6E 61 6D 61 72 69 61 40 76 69 6F 6C 65 T:anamaria@viole
8849 A: 74 2E 62 65 72 6B 65 6C 65 79 2E 65 64 75 0D 0A t.berkeley.edu..
8859 A: 46 72 6F 6D 3A 20 45 72 6E 79 20 54 6F 6E 74 6C From: Erny Tontl
8865 A: 69 6E 67 65 72 0D 0A 53 75 62 6A 3A 20 46 69 6C inger..Subj: Fil
The first column gives the relative time in ticks (60.15 ticks per second)
when the buffer was dumped to the file, this is not necessary the time when
the characters were received. Then there is the port id: port A (modem) or
port B (printer) followed by the hexadecimal representation of up to 16
characters. In the right part is the 7 bit ASCII representation of the
characters. Control characters show up as '.'.
___________________________________________________________________________
COMMENTS AND SUGGESTIONS
Send any comments, bug reports and suggestions to my address:
Erny Tontlinger
33, route d'Arlon
L-8410 Steinfort
Luxembourg
or via electronic mail to my CompuServe account 73720,2200 (this can also
be done via Internet using the address 73720.2200@compuserve.com). I'am a
radio amateur, so you can reach me via the packet radio network at LX1YZ @
LX0PAC.
This program is absolutely free, including the C sources. So do with it
what you like, but please include the documentation if you give it away.